---
title:        'Bitmap to C/C++ Converter'
description:  'Convert a JPEG or PNG file to a C/C++ byte array.'
category:     [ tools ]
---

<script type="text/javascript" src="./converter.js"></script>

<div class="container" role="main">
  <div class="row">
    <div class="col-lg-12" id="bitmap-converter">
      <h1 class="left13">Bitmap Converter</h1>
      <div class="right23">
        <p>Convert image files and data into Marlin Boot Screens and Status Screen Logos for Graphical Displays. Dark colors show up as "on" pixels. Light colors will be transparent.</p>
      </div>
      <div class="file-selector">
        <canvas id="preview-sm" width="32" height="32"></canvas>
        <canvas id="preview-lg" width="32" height="32"></canvas>
        <div id="err-box"></div>
        <input type="text" id="pasted" size="30" autocomplete="off" />
        <input type="file" id="file-input" accept="image/*" />
        <div class="options">
          <label title="Marlin 1.x">&nbsp;<input type="radio" name="marlin-ver" value="1" />&nbsp;Marlin 1.x</label>
          <label title="Marlin 2.x">&nbsp;<input type="radio" name="marlin-ver" value="2" checked="checked" />&nbsp;Marlin 2.x</label>
          <br/>
          <label id="liton-lbl" title="Light pixels are solid.">&nbsp;&nbsp;<input type="checkbox" id="lit-on" />&nbsp;Light</label>
          <label title="Invert the output bits.">&nbsp;&nbsp;<input type="checkbox" id="inv-on" />&nbsp;Invert</label>
          <label title="Output in Binary (not Hex) format.">&nbsp;&nbsp;<input type="checkbox" id="bin-on" checked="checked" />&nbsp;Binary</label>
          <label title="Include an ASCII representation.">&nbsp;&nbsp;<input type="checkbox" id="ascii-on" />&nbsp;ASCII Art</label>
          <label title="Use UTF8 blocks instead of ASCII.">&nbsp;&nbsp;<input type="checkbox" id="skinny-on" />&nbsp;Narrow</label>
          <br/>
          <label title="Generic bitmap.">&nbsp;&nbsp;<input type="radio" name="bitmap-type" value="bits" checked="checked" />&nbsp;Bitmap</label>
          <label title="Format for _Bootscreen.h">&nbsp;<input type="radio" name="bitmap-type" value="boot" />&nbsp;Boot</label>
          <label title="Format for _Statusscreen.h">&nbsp;<input type="radio" name="bitmap-type" value="stat" />&nbsp;Status</label>
          <span id="stat-sub">
            :<label title="Right-justify the image.">&nbsp;&nbsp;<input type="checkbox" id="rj-on" />&nbsp;&gt;&gt;</label>
            <label class="tbd" title="Overlay a bed image.">&nbsp;&nbsp;<input type="checkbox" id="bed-on" />&nbsp;Bed</label>
            <label class="tbd" title="Overlay a fan image.">&nbsp;&nbsp;<input type="checkbox" id="fan-on" />&nbsp;Fan</label>
            <label class="tbd">&nbsp;&nbsp;Nozzles:
              <select name="hotends" value="1">
                <option value="0">0</option>
                <option value="1">1</option>
                <option value="2">2</option>
                <option value="3">3</option>
                <option value="4">4</option>
                <option value="5">5</option>
              </select>
            </label>
          </span>
        </div>
      </div>
      <div id="cpp-container">
        <p>Copy the following code into your <span id="where">program</span>:</p>
        <textarea id="output" cols="80" rows="4" editable="false" wrap="off" readonly="readonly">Select or drop an image above.</textarea>
      </div>
    </div>
  </div>
</div>
